// 代理商管理
import http from '../helper/http.js'
const path = '/api/adm/v1/'

// 代理商列表
export let agentList = ({ startTime, endTime, searchType, provinceId, cityId, districtId, level, name, page, num }) => {
  return http.post(`${path}agent/search`, {
    start_time: startTime,
    end_time: endTime,
    search_type: searchType,
    province_id: provinceId,
    city_id: cityId,
    district_id: districtId,
    level, // 代理等级 0 全部 1 省 2市 3区县
    name,
    page,
    num
  })
}

// 代理商余额提现列表和查询
export let getAgwithdraw = ({ verifyType, startTime, endTime, searchType, page = 1, name, num }) => {
  return http.post(`${path}agwithdraw/search`, {
    verify_type: verifyType, // 审核状态 0全部 1 未处理 2 已审核 3已拒绝
    start_time: startTime,
    end_time: endTime,
    search_type: searchType, // 0 所以符合条件  1 代理商id  2 代理商姓名 3 代理商手机号 4 流水号
    name,
    page,
    num
  })
}

// 代理商余额提现审核
export let updateAgwithdraw = ({ id, memo, status }) => {
  return http.post(`${path}agwithdraw/update`, {
    id,
    memo,
    status
  })
}

// 代理商余额提现详情
export let getAgwithdrawDetail = ({ id }) => {
  return http.post(`${path}agwithdraw/show`, {
    id
  })
}

// 代理商提现列表导出/api/adm/v1/agwithdraw/export
export let agwithdrawExport = (params) => {
  return http.post(`${path}agwithdraw/export`, params)
}
